#import "RRLoginDialog.h"
#import "Request.h"

@protocol RRSessionDelegate;

@interface Renren : NSObject<RRLoginDialogDelegate>{
  NSString* _accessToken;
  NSString* _sessionKey;
  NSString* _secret;
  NSDate* _expirationDate;
  NSString* _createTime;
  id<RRSessionDelegate> _sessionDelegate;
  Request* _request;
  RRDialog* _loginDialog;
  RRDialog* _rrDialog;
  NSString* _appId;
  NSString* _appKey;
  NSArray* _permissions;
}

@property(nonatomic, copy) NSString* accessToken;

@property(nonatomic, copy) NSString* sessionKey;

@property(nonatomic,copy) NSString* secret;

@property(nonatomic, copy) NSDate* expirationDate;

@property(nonatomic, assign) id<RRSessionDelegate> sessionDelegate;

- (id)initWithAppKeyAndId:(NSString *)app_key andAppId:(NSString *)app_id;

- (void)authorize:(NSArray *)permissions
         delegate:(id<RRSessionDelegate>)delegate;

- (void)logout:(id<RRSessionDelegate>)delegate;

- (Request*)requestWithParams:(NSMutableDictionary *)params
                    andDelegate:(id <RequestDelegate>)delegate;

- (BOOL)isSessionValid;

@end

 
@protocol RRSessionDelegate <NSObject>

@optional
 
- (void)rrDidLogin;
 
- (void)rrDidNotLogin:(BOOL)cancelled;

- (void)rrDidLogout;

@end
